<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            color: black;
            background-color: aqua;
            font-size: 30px;
        }
    </style>
</head>

<body>
    <div class="box">

    </div>
    <div>
        点击触发事件,重复点击也需要间隔两秒
    </div>
    <script src="./lodash.min.js"></script>
    <script>
        let box = document.querySelector(`.box`)
        let i = 1
        function fn() {
            box.innerHTML = i++   //执行代码
        }                                 //节流   函数名 间隔时间
        box.addEventListener(`click`, _.throttle(fn, 2000))
    </script>
</body>

</html>